Integrand size = 29, antiderivative size = 46 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\text {arctanh}(\sin (c+d x))}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3171, 3169, 2717, 2718, 2672, 327, 212} \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\text {arctanh}(\sin (c+d x))}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d} \]
[In]
[Out]
Rule 212
Rule 327
Rule 2672
Rule 2717
Rule 2718
Rule 3169
Rule 3171
Rubi steps \begin{align*} \text {integral}& = -\frac {\int \sec (c+d x) (i a \cos (c+d x)+a \sin (c+d x))^2 \, dx}{a^4} \\ & = -\frac {\int \left (-a^2 \cos (c+d x)+2 i a^2 \sin (c+d x)+a^2 \sin (c+d x) \tan (c+d x)\right ) \, dx}{a^4} \\ & = -\frac {(2 i) \int \sin (c+d x) \, dx}{a^2}+\frac {\int \cos (c+d x) \, dx}{a^2}-\frac {\int \sin (c+d x) \tan (c+d x) \, dx}{a^2} \\ & = \frac {2 i \cos (c+d x)}{a^2 d}+\frac {\sin (c+d x)}{a^2 d}-\frac {\text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d} \\ & = \frac {2 i \cos (c+d x)}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d}-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d} \\ & = -\frac {\text {arctanh}(\sin (c+d x))}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(184\) vs. \(2(46)=92\).
Time = 0.36 (sec) , antiderivative size = 184, normalized size of antiderivative = 4.00 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\sec ^2(c+d x) \left (\cos \left (\frac {1}{2} (c+d x)\right ) \left (2 i+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (2+i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {3}{2} (c+d x)\right )+i \sin \left (\frac {3}{2} (c+d x)\right )\right )}{a^2 d (-i+\tan (c+d x))^2} \]
[In]
[Out]
Time = 0.60 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.17
method | result | size |
derivativedivides | \(\frac {-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i}}{a^{2} d}\) | \(54\) |
default | \(\frac {-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i}}{a^{2} d}\) | \(54\) |
risch | \(\frac {2 i {\mathrm e}^{-i \left (d x +c \right )}}{a^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{2} d}-\frac {\ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{a^{2} d}\) | \(61\) |
norman | \(\frac {\frac {4 i}{a d}+\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) a}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2} d}\) | \(87\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.39 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {{\left (e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2} d} \]
[In]
[Out]
\[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {\int \frac {\sec {\left (c + d x \right )}}{- \sin ^{2}{\left (c + d x \right )} + 2 i \sin {\left (c + d x \right )} \cos {\left (c + d x \right )} + \cos ^{2}{\left (c + d x \right )}}\, dx}{a^{2}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (44) = 88\).
Time = 0.31 (sec) , antiderivative size = 117, normalized size of antiderivative = 2.54 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {-2 i \, \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 2 i \, \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) - 4 i \, \cos \left (d x + c\right ) + \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) - 4 \, \sin \left (d x + c\right )}{2 \, a^{2} d} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.24 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} - \frac {4}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}}}{d} \]
[In]
[Out]
Time = 22.95 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.96 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}+\frac {4{}\mathrm {i}}{a^2\,d\,\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )} \]
[In]
[Out]